﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace JunQuanPrinter
{
    class CTool
    {
        public static void ShowMsg(String sHint)
        {
            MessageBox.Show(sHint, "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static DialogResult ShowMsgQ(String sHint)
        {
            return MessageBox.Show(sHint, "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        }

        public static void ShowMsgW(String sHint)
        {
            MessageBox.Show(sHint, "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        public static void ShowMsgErr(String sHint)
        {
            MessageBox.Show(sHint, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static bool arrayEquals(byte[] ary1, byte[] ary2)
        {
            if ((ary1 == null) || (null == ary2))
            {
                return false;
            }
            if (ary1.Length != ary2.Length)
            {
                return false;
            }
            for (int i = 0; i < ary1.Length; i++)
            {
                if (ary1[i] != ary2[i])
                {
                    return false;
                }
            }
            return true;
        }
    }
}
